import { useLocation } from 'react-router-dom';

/**
 * 获取hash参数
 */
export default function useHashParams() {
  const location = useLocation();
  const params = new URLSearchParams(location.hash.slice(1));
  const json = {};
  for (const [key, value] of params) {
    json[key] = value;
  }
  return json;
}
